package com.hex.liyue.usermodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.usermodule.bean.MoreRecordsResultBean;

/**
 * Created by WJ on 2016/6/26.
 */
public class MoreRecordsPresenter  {
    private IMoreRecordsView iMoreRecordsView;

    public MoreRecordsPresenter(IMoreRecordsView iMoreRecordsView) {
        this.iMoreRecordsView = iMoreRecordsView;
    }
    public void getTransactionRecords(int page,int page_num){
        iMoreRecordsView.showLod("加载中...");
        HttpManager.getInstance().user_getTransactionRecords(UserManager.getUserId(), page, page_num, new ResponseListener<MoreRecordsResultBean>() {
            @Override
            public void onSuccess(MoreRecordsResultBean moreRecordsResultBean) {
                iMoreRecordsView.closeLod();
                iMoreRecordsView.setAdapter(moreRecordsResultBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iMoreRecordsView.closeLod();
                iMoreRecordsView.showLod(responseresult);
            }
        });
    }
}
